]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensionSystem: Check if mode is supported when loading
authorAlessandro Bono <alessandro.bono369@gmail.com>
Thu, 14 Jul 2022 13:37:42 +0000 (15:37 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 27 Jul 2022 14:01:30 +0000 (14:01 +0000)
Don't try to initialize and then enable an extension if it is not supported
in the current mode. Otherwise the extension will not be initialized, and the
initial ERROR state is not cleared. Once it is in ERROR state we can't enable
it anymore when we switch mode. Instead, leave the extension in INITIALIZED
state, so that it will be initialized when appropriate. This happens for
extensions that support the unlock-dialog mode but not the user mode.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2378>

js/ui/extensionSystem.js

index ca96a99f4f9be9c7ab947b0c2858e8f05f122a7c..c21cc7cded012660970465edd0e7625980759c8c 100644 (file)
@@ -376,7 +376,8 @@ var ExtensionManager = class extends Signals.EventEmitter {
             this.logExtensionError(extension.uuid, new Error(
                 'A different version was loaded previously. You need to log out for changes to take effect.'));
         } else {
-            let enabled = this._enabledExtensions.includes(extension.uuid);
+            let enabled = this._enabledExtensions.includes(extension.uuid) &&
+                          this._extensionSupportsSessionMode(extension.uuid);
             if (enabled) {
                 if (!this._callExtensionInit(extension.uuid))
                     return;